home *** CD-ROM | disk | FTP | other *** search
/ 3D Game Programming All in One / 3D Game Programming All in One Disc.iso / 3D2E / RESOURCES / KOOB / common / server / commands.cs < prev    next >
Text File  |  2006-09-25  |  2KB  |  47 lines

  1. //-----------------------------------------------------------------------------
  2. // Torque Game Engine 
  3. // Copyright (C) GarageGames.com, Inc.
  4. //-----------------------------------------------------------------------------
  5.  
  6. //-----------------------------------------------------------------------------
  7. // Misc. server commands avialable to clients
  8. //-----------------------------------------------------------------------------
  9.  
  10. //-----------------------------------------------------------------------------
  11.  
  12. function serverCmdSAD( %client, %password )
  13. {
  14.    if( %password !$= "" && %password $= $Pref::Server::AdminPassword)
  15.    {
  16.       %client.isAdmin = true;
  17.       %client.isSuperAdmin = true;
  18.       %name = getTaggedString( %client.name );
  19.       MessageAll( 'MsgAdminForce', "\c2" @ %name @ " has become Admin by force.", %client );   
  20.    }
  21. }
  22.  
  23. function serverCmdSADSetPassword(%client, %password)
  24. {
  25.    if(%client.isSuperAdmin)
  26.       $Pref::Server::AdminPassword = %password;
  27. }
  28.  
  29.  
  30. //----------------------------------------------------------------------------
  31. // Server chat message handlers
  32.  
  33. function serverCmdTeamMessageSent(%client, %text)
  34. {
  35.    if(strlen(%text) >= $Pref::Server::MaxChatLen)
  36.       %text = getSubStr(%text, 0, $Pref::Server::MaxChatLen);
  37.    chatMessageTeam(%client, %client.team, '\c3%1: %2', %client.name, %text);
  38. }
  39.  
  40. function serverCmdMessageSent(%client, %text)
  41. {
  42.    if(strlen(%text) >= $Pref::Server::MaxChatLen)
  43.       %text = getSubStr(%text, 0, $Pref::Server::MaxChatLen);
  44.    chatMessageAll(%client, '\c4%1: %2', %client.name, %text);
  45. }
  46.  
  47.